\(\int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx\) [534]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 22 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {(a+b \tan (c+d x))^4}{4 b d} \]

[Out]

1/4*(a+b*tan(d*x+c))^4/b/d

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3587, 32} \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {(a+b \tan (c+d x))^4}{4 b d} \]

[In]

Int[Sec[c + d*x]^2*(a + b*Tan[c + d*x])^3,x]

[Out]

(a + b*Tan[c + d*x])^4/(4*b*d)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int (a+x)^3 \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {(a+b \tan (c+d x))^4}{4 b d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(57\) vs. \(2(22)=44\).

Time = 0.18 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.59 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {\tan (c+d x) \left (4 a^3+6 a^2 b \tan (c+d x)+4 a b^2 \tan ^2(c+d x)+b^3 \tan ^3(c+d x)\right )}{4 d} \]

[In]

Integrate[Sec[c + d*x]^2*(a + b*Tan[c + d*x])^3,x]

[Out]

(Tan[c + d*x]*(4*a^3 + 6*a^2*b*Tan[c + d*x] + 4*a*b^2*Tan[c + d*x]^2 + b^3*Tan[c + d*x]^3))/(4*d)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(71\) vs. \(2(20)=40\).

Time = 4.50 (sec) , antiderivative size = 72, normalized size of antiderivative = 3.27

method result size
derivativedivides \(\frac {\frac {b^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{4 \cos \left (d x +c \right )^{4}}+\frac {a \,b^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+\frac {3 a^{2} b}{2 \cos \left (d x +c \right )^{2}}+a^{3} \tan \left (d x +c \right )}{d}\) \(72\)
default \(\frac {\frac {b^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{4 \cos \left (d x +c \right )^{4}}+\frac {a \,b^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+\frac {3 a^{2} b}{2 \cos \left (d x +c \right )^{2}}+a^{3} \tan \left (d x +c \right )}{d}\) \(72\)
risch \(-\frac {2 \left (-i a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+3 i a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-3 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-3 i a^{3} {\mathrm e}^{4 i \left (d x +c \right )}+3 i a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}-3 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-i a^{3}+i a \,b^{2}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}\) \(197\)

[In]

int(sec(d*x+c)^2*(a+b*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/4*b^3*sin(d*x+c)^4/cos(d*x+c)^4+a*b^2*sin(d*x+c)^3/cos(d*x+c)^3+3/2*a^2*b/cos(d*x+c)^2+a^3*tan(d*x+c))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 78 vs. \(2 (20) = 40\).

Time = 0.24 (sec) , antiderivative size = 78, normalized size of antiderivative = 3.55 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {b^{3} + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left (a b^{2} \cos \left (d x + c\right ) + {\left (a^{3} - a b^{2}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{4}} \]

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/4*(b^3 + 2*(3*a^2*b - b^3)*cos(d*x + c)^2 + 4*(a*b^2*cos(d*x + c) + (a^3 - a*b^2)*cos(d*x + c)^3)*sin(d*x +
c))/(d*cos(d*x + c)^4)

Sympy [F]

\[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{3} \sec ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)**2*(a+b*tan(d*x+c))**3,x)

[Out]

Integral((a + b*tan(c + d*x))**3*sec(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {{\left (b \tan \left (d x + c\right ) + a\right )}^{4}}{4 \, b d} \]

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

1/4*(b*tan(d*x + c) + a)^4/(b*d)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (20) = 40\).

Time = 0.74 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.59 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {b^{3} \tan \left (d x + c\right )^{4} + 4 \, a b^{2} \tan \left (d x + c\right )^{3} + 6 \, a^{2} b \tan \left (d x + c\right )^{2} + 4 \, a^{3} \tan \left (d x + c\right )}{4 \, d} \]

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

1/4*(b^3*tan(d*x + c)^4 + 4*a*b^2*tan(d*x + c)^3 + 6*a^2*b*tan(d*x + c)^2 + 4*a^3*tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 4.41 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.50 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {a^3\,\mathrm {tan}\left (c+d\,x\right )+\frac {3\,a^2\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2}+a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3+\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4}}{d} \]

[In]

int((a + b*tan(c + d*x))^3/cos(c + d*x)^2,x)

[Out]

(a^3*tan(c + d*x) + (b^3*tan(c + d*x)^4)/4 + (3*a^2*b*tan(c + d*x)^2)/2 + a*b^2*tan(c + d*x)^3)/d